<th:block th:fragment="frag(app)">
	<div class="box" th:attrappend="class=${app.metaShowViews ? '' : ' collapsed-box'}">
		<div class="box-header with-border">
			<th:block th:include="tool-collapse :: frag(${!app.metaShowViews})"></th:block>
			<h3 class="box-title">MViews</h3>
		</div>
		<div class="box-body">
			<div class="nav-tabs-custom">
			<ul class="nav nav-tabs">
				<th:block th:each="p : ${app.views}">
					<li th:class="${p.metaActive ? 'active' : ''}">
						<a th:href="|#divMViewContent-${p.id}|" data-toggle="tab">
							<span th:text="${p.name}"></span>
						</a>
					</li>
				</th:block>
			</ul>
			<div class="tab-content">
				<th:block th:each="p : ${app.views}">
					<div class="tab-pane" th:id="|divMViewContent-${p.id}|" th:attrappend="class=${p.metaActive ? ' active' : ''}">
						<div class="row">
							<div class="col-md-12">
								<div class="box" th:attrappend="class=${p.metaShow ? '' : ' collapsed-box'}">
									<!-- Main content -->
									<div class="box-header with-border">
										<th:block th:include="tool-collapse :: frag(${!p.metaShow})"></th:block>
										<h3 class="box-title">MView</h3>
									</div>
									<div class="box-body">
										<table class="table table-bordered" data-meta-po="MView">
											<tbody><tr>
												<th class="col-md-4">属性</th>
												<th class="col-md-5">值</th>
												<th class="col-md-3">操作</th>
											</tr>
											<th:block th:with="objectPropertyNames=${T(java.util.Arrays).asList('id', 'name', 'type', 'width', 'height',  'columns', 'idx')}">
												<th:block th:each="property : ${objectPropertyNames}">
													<tr th:if="${property == 'id'}">
														<td>id</td>
														<td th:text="${p.id}"></td>
														<td>
														</td>
													</tr>
													<tr th:unless="${property == 'id'}">
														<td th:text="${property}"></td>
														<td><input class="form-control input-sm" th:value="${p[property]}"></td>
														<td>
															<th:block th:include="meta/man/object-operations :: frag(${p}, ${property})"></th:block>
														</td>
													</tr>
												</th:block>
												<th:block th:each="key : ${p.data.keySet()}">
													<tr>
														<td th:text="${'data.' + key}"></td>
														<td><input class="form-control input-sm" th:value="${p.data.get(key)}"></td>
														<td>
															<th:block th:include="meta/man/object-operations :: frag(${p}, ${'data.' + key})"></th:block>
														</td>
													</tr>
												</th:block>
												<tr>
													<td><input class="form-control input-sm" name="key"></td>
													<td><input class="form-control input-sm" name="value"></td>
													<td>
														<div class="btn-group btn-xs">
															<button type="button" class="btn btn-xs" data-meta-add>Add</button>
														</div>
													</td>
												</tr>
												<tr>
													<td>
													  <select class="form-control input-sm" name="propertyId">
									                    <option th:each="mProperty : ${object.properties}" th:value="${mProperty.id}" th:text="${mProperty.description}"></option>
									                  </select>
									                  <select class="form-control input-sm" name="viewPropertyType">
									                    <option value="textfield">文本</option>
									                    <option value="numberfield">数字</option>
									                    <option value="textarea">多行文本</option>
									                    <option value="datetime">日期时间</option>
									                    <option value="radio">单选</option>
									                    <option value="combo">下拉框</option>
									                    <option value="checkbox">多选</option>
									                    <option value="file">文件</option>
									                    <option value="image">图片</option>
									                    <option value="hidden">隐藏</option>
									                  </select>
													</td>
													<td>
														<textarea class="form-control input-sm" name="viewPropertyConfig" placeholder="视图属性配置，格式：索引:1,数据字典:gender"></textarea>
													</td>
													<td>
														<div class="btn-group btn-xs">
															<button type="button" class="btn btn-xs" data-meta-addMViewPropertyByMProperty>Add</button>
														</div>
													</td>
												</tr>
												<tr>
													<td>
													  <select class="form-control input-sm" name="relationId">
									                    <option th:each="mRelation : ${object.relations}" th:value="${mRelation.id}" th:text="|${mRelation.name}-${mRelation.type}|"></option>
									                  </select>
									                  <select class="form-control input-sm" name="viewPropertyType">
									                    <option value="objectSelector">对象选择器</option>
									                    <option value="hidden">隐藏</option>
									                  </select>
													</td>
													<td>
														<textarea class="form-control input-sm" name="viewPropertyConfig" placeholder="视图属性配置，格式：索引:1"></textarea>
													</td>
													<td>
														<div class="btn-group btn-xs">
															<button type="button" class="btn btn-xs" data-meta-addMViewPropertyByMRelation>Add</button>
														</div>
													</td>
												</tr>
											</th:block>
											</tbody></table>
									</div>
									<!-- /.content -->
								</div>
							</div>
						</div>
						<div class="row">
							<div class="col-md-6">
								<th:block th:include="meta/man/object-view-properties :: frag(${p})"></th:block>
								<!-- /.box -->
							</div>
							<div class="col-md-6">
								<th:block th:include="meta/man/object-view-buttons :: frag(${p})"></th:block>
							</div>
						</div>
					</div>
				</th:block>
			</div>
			<!-- /.tab-content -->
		</div>
		</div>
	</div>
</th:block>